package com.ssh.service;

import com.ssh.dao.UserDao;
import com.ssh.domain.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Transactional
@Service("userService")
public class UserService {
    @Resource
    private UserDao userDao;

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    /**
     * 查询所有
     * @return
     */
    public List<User> getUsers() {
        return userDao.getUsers();
    }

    public void addUser(User user) {
        userDao.addUser(user);
    }
}
